import { createWebHistory, createWebHashHistory, createRouter } from 'vue-router'
import { setToken,getTokenFromCookie } from '@/utils/auth'

// 公共路由
export const constantRoutes = [
  {
    path: "",
    redirect: "/index"
  },
  {
    path: '/index',
    component: () => import('@/components/smartWeather/index.vue'),
    hidden: true
  }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes: constantRoutes,
  scrollBehavior(to, from, savedPosition) {
    if (savedPosition) {
      return savedPosition
    } else {
      return { top: 0 }
    }
  },
});



export default router;